package com.ssm.hj.controller;

import com.github.pagehelper.PageInfo;
import com.ssm.hj.page.Page;
import com.ssm.hj.search.MemberSearch;
import com.ssm.hj.service.InterposeSchemeService;
import com.ssm.hj.view.InterposeSchemeView;
import com.ssm.hj.view.MouldMap;
import com.ssm.pojo.Member;
import com.ssm.pojo.Mould;
import com.ssm.pojo.TInterposeScheme;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class InterposeSchemeController {
    @Resource
    private InterposeSchemeService interposeSchemeService;

    @RequestMapping("/hj/queryMemberGroupClassification")
    public PageInfo<Member> queryMemberGroupClassification(@RequestBody Page<MemberSearch> page) throws Exception{
        return this.interposeSchemeService.queryMemberGroupClassificationService(page);
    }
    @RequestMapping("/hj/queryBookIngById")
    public InterposeSchemeView queryBookIngById(int rid) throws Exception {
        return this.interposeSchemeService.queryBookIngByIdService(rid);
    }
    @RequestMapping("/hj/queryMould")
    public List<Mould> queryMouldAll() throws Exception {
        return this.interposeSchemeService.queryMouldAllService();
    }
    @RequestMapping("/hj/queryMouldById")
    public MouldMap queryMouldByIdService(int id) throws Exception {
        return this.interposeSchemeService.queryMouldByIdService(id);
    }
    @RequestMapping("/hj/addOrUpdateTInterposeScheme")
    public int addOrUpdateTInterposeScheme(@RequestBody TInterposeScheme tInterposeScheme) throws Exception {
        return this.interposeSchemeService.addOrUpdateTInterposeSchemeService(tInterposeScheme);
    }
    @RequestMapping("/hj/updateStateService")
    public int updateStateService(int rid) throws Exception {
        return this.interposeSchemeService.updateStateService(rid);
    }
}
